package com.health.medicine.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import lombok.Data;

/**
 * 运输单位信息表
 * @TableName TransportUnit
 */
@TableName(value ="TransportUnit")
@Data
public class TransportUnit implements Serializable {
    /**
     * 运输单位唯一标识
     */
    @TableId(type = IdType.AUTO)
    private Long transportUnitId;

    /**
     * 运输单位名称
     */
    private String name;

    /**
     * 运输商账号
     */
    private String transportAccount;

    /**
     * 联系人姓名
     */
    private String contactPerson;

    /**
     * 联系电话
     */
    private String contactPhone;

    /**
     * 联系邮箱
     */
    private String contactEmail;


    /**
     * 运输单位的注册编号
     */
    private String registrationNumber;

    /**
     * 运输类型
     */
    private Integer transportType;

    /**
     * 可用车辆数量
     */
    private Integer availableVehicles;

    /**
     * 许可证有效期
     */
    private LocalDateTime licenseValidityDate;

    /**
     * 保险详情
     */
    private String insuranceDetails;

    /**
     * 运输单位状态
     */
    private Integer status;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    private LocalDateTime updateTime;

    /**
     * 是否删除 0-未删除 1-删除
     */
    private Integer isDelete;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TransportUnit other = (TransportUnit) that;
        return (this.getTransportUnitId() == null ? other.getTransportUnitId() == null : this.getTransportUnitId().equals(other.getTransportUnitId()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getTransportAccount() == null ? other.getTransportAccount() == null : this.getTransportAccount().equals(other.getTransportAccount()))
            && (this.getContactPerson() == null ? other.getContactPerson() == null : this.getContactPerson().equals(other.getContactPerson()))
            && (this.getContactPhone() == null ? other.getContactPhone() == null : this.getContactPhone().equals(other.getContactPhone()))
            && (this.getContactEmail() == null ? other.getContactEmail() == null : this.getContactEmail().equals(other.getContactEmail()))
            && (this.getRegistrationNumber() == null ? other.getRegistrationNumber() == null : this.getRegistrationNumber().equals(other.getRegistrationNumber()))
            && (this.getTransportType() == null ? other.getTransportType() == null : this.getTransportType().equals(other.getTransportType()))
            && (this.getAvailableVehicles() == null ? other.getAvailableVehicles() == null : this.getAvailableVehicles().equals(other.getAvailableVehicles()))
            && (this.getLicenseValidityDate() == null ? other.getLicenseValidityDate() == null : this.getLicenseValidityDate().equals(other.getLicenseValidityDate()))
            && (this.getInsuranceDetails() == null ? other.getInsuranceDetails() == null : this.getInsuranceDetails().equals(other.getInsuranceDetails()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getIsDelete() == null ? other.getIsDelete() == null : this.getIsDelete().equals(other.getIsDelete()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getTransportUnitId() == null) ? 0 : getTransportUnitId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getTransportAccount() == null) ? 0 : getTransportAccount().hashCode());
        result = prime * result + ((getContactPerson() == null) ? 0 : getContactPerson().hashCode());
        result = prime * result + ((getContactPhone() == null) ? 0 : getContactPhone().hashCode());
        result = prime * result + ((getContactEmail() == null) ? 0 : getContactEmail().hashCode());
        result = prime * result + ((getRegistrationNumber() == null) ? 0 : getRegistrationNumber().hashCode());
        result = prime * result + ((getTransportType() == null) ? 0 : getTransportType().hashCode());
        result = prime * result + ((getAvailableVehicles() == null) ? 0 : getAvailableVehicles().hashCode());
        result = prime * result + ((getLicenseValidityDate() == null) ? 0 : getLicenseValidityDate().hashCode());
        result = prime * result + ((getInsuranceDetails() == null) ? 0 : getInsuranceDetails().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getIsDelete() == null) ? 0 : getIsDelete().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", transportUnitId=").append(transportUnitId);
        sb.append(", name=").append(name);
        sb.append(", transportAccount=").append(transportAccount);
        sb.append(", contactPerson=").append(contactPerson);
        sb.append(", contactPhone=").append(contactPhone);
        sb.append(", contactEmail=").append(contactEmail);
        sb.append(", registrationNumber=").append(registrationNumber);
        sb.append(", TransportType=").append(transportType);
        sb.append(", availableVehicles=").append(availableVehicles);
        sb.append(", licenseValidityDate=").append(licenseValidityDate);
        sb.append(", insuranceDetails=").append(insuranceDetails);
        sb.append(", status=").append(status);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", isDelete=").append(isDelete);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}